<%--
  Created by IntelliJ IDEA.
  User: xiayingjie
  Date: 16/8/17
  Time: 下午3:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <title></title>
  <script language="JavaScript">
      //var url="ws://"+window.location.host+"/socket";
      var url="http://"+window.location.host+"/socket";
      var sock=new WebSocket(url);
    sock.onopen =function(){
      console.log('opening')
      sock.send("hello");
    }
    sock.onmessage=function(e){
      console.log("received:"+ e.data);
    }
    sock.onclose=function(){
      console.log("close")
    }


  </script>
</head>
<body>
    <input type="text"/>
</body>
</html>
